package TokenRecognizer;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author jefoutta
 */
public class Prueba {

    public static void main (String[]args){

        AutomataMaker evaluador = new AutomataMaker(".*|baa");
        Automata test = evaluador.getThombson();
        test.setLabel();
        System.out.println(test.toString());
        test.toFile("afn");
        Automata test2 = evaluador.evalSubset(test);
        System.out.println(test2.toString());
        test2.setLabel();
        test2.toFile("afd");
        Automata test3 = evaluador.getDirectAFD();
        test3.setLabel();
        test3.toFile("directADF");
        AFDSimulator afdSimulator = new AFDSimulator();
        AFNSimulator afnSimulator = new AFNSimulator();
        boolean is = afdSimulator.simulate("baaaabbaaaaaaaba", test2);
        if(is)
            System.out.println("si es reconocido");
        else
            System.out.println("no es reconocido");
        boolean isn = afnSimulator.simulate("baaabbaa", test);
        if(isn)
            System.out.println("si es reconocido");
        else
            System.out.println("no es reconocido");
        boolean is2 = afdSimulator.simulate("baaaabbaaaaaaab", test3);
        if(is2)
            System.out.println("si es reconocido");
        else
            System.out.println("no es reconocido");
        //System.out.println(evaluador.evalSubset(test));
    }
}
